<?
include_once "gblInclude.lib";

$objName = $_GET["obj_name"];
$attrName = $_GET["attr_name"];
$parentEnumKey = $_GET["parent_enum_key"];

global $gblDBConnect;
		
$sql = "SELECT enum_key, enum_value
	 	FROM tb_custom_enum 
	 	WHERE object_name='".$objName."' AND attr_name='".$attrName."' AND parent_enum_key=".$parentEnumKey;

try
{
	$enumList = $gblDBConnect->getAll($sql);
}
catch(PDOException $ex)
{
	LogError("Get Attr Enum List SQL  ___ ".$sql);
}

$res = array();

foreach($enumList as $tmpObj)
{
	$tmpObj->enum_value = mb_convert_encoding($tmpObj->enum_value,"UTF-8","GB2312");
	$res[] = $tmpObj;
}

echo json_encode($res);
?>